Ext.define('appmod.view.role.authorization.Form', {
    extend: 'Ext.form.Panel',
    alias: 'widget.roleauthorizationform',
	requires:[
		'appmod.view.role.authorization.Module',
		'appmod.view.role.authorization.Menu'
	],
	
	constructor: function (config) {
		
		if (config.fieldStores) {
			this.stores = config.stores;
		}
        this.callParent(arguments);
     },	
	
    initComponent: function() {
        var me = this;
		
		var stores = me.stores;
		
		var dsMenuTree = stores['menuTree'];

        Ext.applyIf(me, {
			bodyStyle:'padding:5px',
            items: [
                {
                    xtype: 'displayfield',
                    name: 'roleName',
					labelWidth : 60,
                    fieldLabel: '授权角色',
                    anchor: '100%'
                },
                {
                    xtype: 'hiddenfield',
                    name: 'roleId',
                    fieldLabel: 'Label',
                    anchor: '100%'
                },
				{
					xtype:'panel',
                    height: 518,
                    layout: {
                    	type: 'border'
                    },
					frame:true,
					items:[{
                   		xtype: 'tabpanel',
						region:'center',
						activeTab: 0,
						plain:true,
                    	items: [
						{
                    		xtype: 'role.auth.modulepanel',
                        	title: '模块功能授权'
                    	},{
                    		xtype: 'menuauthorizationpanel',
                        	title: '菜单授权',
							//store:'role.menu.Tree'
							store:dsMenuTree
                    	}
                    	]					
					}
 					]										
				}
            ]
        });

        me.callParent(arguments);
    }

});